package com.lanca.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用商品服务的接口
 */
@FeignClient(value = "PRODUCT")  //微服务名称
public interface ProductClient {


    /**
     * 路径@PathVariable
     *
     * @param id
     * @param name
     * @return
     */
    @GetMapping("/test1/{id}/{name}")
    String test1(@PathVariable("id") Integer id, @PathVariable("name") String name);

    @GetMapping("/product")
    String getProduct();


    /**
     * 参数@RequestParam
     *
     * @param name
     * @param age
     * @return
     */
    @GetMapping("/test")
    String test(@RequestParam(value = "name") String name, @RequestParam(value = "age") Integer age);
}
